package com.stream;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;


public class StreamAPIDemo1 {
    public static void main(String[] args) {
        Random random = new Random();
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < 100; i++) {
            list.add(random.nextInt(100));
        }
        System.out.println("list = " + list);
        //Stream<Integer> stream = list.stream();
        List<Integer> list2 = list.stream()
                                .map(e -> e * 10)
                                .collect(Collectors.toList());
        System.out.println("list2 = " + list2);
    }
}
